<template>
    <div class="smallSon">
        颜值：{{handsome}}，
        工作：{{actor}}
        薪资：{{money}}元
        <button @click="gambleHouse($parent)">赌掉父亲公司</button>
        
    </div>
</template>
<script setup>
import {ref} from 'vue'
let handsome = ref('100')
let actor = ref('演员')
let money = ref(103)

function gambleHouse(){
    //parent是reactive对象，所以parent可以不.value。★
    parent.company -= 1;
    // console.log(parent);
}
//将数据暴露给父组件使用★
defineExpose({handsome,actor,money})
</script>
<style scoped>
.smallSon{
    height: 20vh;
    width: 50vw;
    background-color: rgb(102, 94, 211);
}
</style>